home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 256_02 / sdatime.a < prev    next >
Encoding:
Text File  |  1988-01-06  |  2.0 KB  |  55 lines

  1. ;---------------------------------------------------------------------
  2. ;    ASM88 FILE:     SDATIME.A     Set Date and Time
  3. ;    ----------
  4. ;    WRITTEN:        25/10/87
  5. ;    -------
  6. ;    PURPOSE:        This is one of a series of files which take
  7. ;    -------         advantage of INT 21H functions under MS-DOS.
  8. ;                    In each case the error situation is marked by
  9. ;                    the carry flag being set.   We use the De Smet
  10. ;                    external variable '_carryf' to see whether the
  11. ;                    carry is set on return from the function.
  12. ;                    If so, the error code can be used to obtain
  13. ;                    information about the specific error.
  14. ;
  15. ;    USAGE:          int SDATIME(handle, time, date, &_carryf)
  16. ;    -----           int handle,  /* the file handle */
  17. ;                        time, date;
  18. ;                    char *_carryf;
  19. ;
  20. ;    DEPENDENCIES:           De Smet C V 2.44+
  21. ;    ------------
  22. ;    Copyright 1987 - Cogar Computer Services Pty. Ltd
  23. ;---------------------------------------------------------------------
  24.  
  25. CSEG
  26. PUBLIC SDATIME_
  27.  
  28. SDATIME_:
  29.     push    bp    ; normal De Smet C start
  30.     mov    bp,sp    ; point to the stack
  31.     mov    ax,ds    ; and make ES common with DS
  32.     mov    es,ax
  33. ;----------------------------------------------------------------------
  34. ;  The unique programme follows.
  35. ;----------------------------------------------------------------------
  36.     mov    bx,[bp+4]    ; the file handle
  37.     mov    cx,[bp+6]    ; the time
  38.     mov    dx,[bp+8]    ; the date
  39.     mov    al,1
  40.     mov    ah,57h    ; the Function No.
  41.     int    21h
  42.     jc    SDATIME_ERROR
  43.     xor    ax,ax    ; prepare for normal return
  44.     jmp    SDATIME_QUIT
  45. SDATIME_ERROR:
  46.     mov    si,[bp+10]    ; get address of '_carryf' variable
  47.     mov    byte [si],1    ; return with _carryf = 1
  48. ;----------------------------------------------------------------------
  49. ;  Normal programme termination.
  50. ;----------------------------------------------------------------------
  51. SDATIME_QUIT:
  52.     pop    bp    ; restore starting conditions
  53.     ret
  54. ;----------------------------------------------------------------------
  55.